9. LiLi_Story

I tried the following commands on Ubuntu16.04.

(ROS Kinetic ONLY supports Wily (Ubuntu 15.10), Xenial (Ubuntu 16.04) and Jessie (Debian 8) for debian packages.)


0. Install Ubuntu16

If you are using Mac OS or Windows OS, you can install an Ubuntu in VirtualBOX. Please make sure you assign a large space, e.g. 20GB, on the page of "File location and size".

1. Install ROS Kinetic Kame

# open a terminal and type in the following commands
> sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
> sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
> sudo apt-get update
> sudo apt-get install ros-kinetic-desktop-full
> sudo rosdep init
> rosdep update
> echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
> source ~/.bashrc
> sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
> sudo apt-get install ros-kinetic-audio-common
# > rosdep install audio-common
> mkdir -p ~/catkin_ws/src
> cd ~/catkin_ws
> catkin_make

2. Install Python and related libraries

#> wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh
#> bash Anaconda2-4.4.0-Linux-x86_64.sh
> sudo apt-get install python-setuptools python-dev build-essential
> sudo easy_install pip
# reopen your teminal
> sudo pip install SpeechRecognition
> sudo pip install gTTS
> sudo pip install nltk
> sudo pip install oauth
> sudo pip install oauth2client
> sudo pip install pyglet
> sudo pip install --upgrade google-api-python-client
# install festival for voice synthesize (text to voice)
> sudo apt-get install festival
# festvox-kallpc16k

3. Download CMU Arctic voices (for better synthesized voices)

> mkdir cmu_tmp
> cd cmu_tmp/
> wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_awb_arctic-0.90-release.tar.bz2
> wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_bdl_arctic-0.95-release.tar.bz2
> wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_clb_arctic-0.95-release.tar.bz2
> wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_jmk_arctic-0.95-release.tar.bz2
> wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_rms_arctic-0.95-release.tar.bz2
> wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_slt_arctic-0.95-release.tar.bz2
# unzip all files
> for t in `ls cmu_*` ; do tar xf $t ; done
> rm *.bz2
# install voices
> sudo mkdir -p /usr/share/festival/voices/english/
> sudo mv * /usr/share/festival/voices/english/
# rename voices based on Festival requires
> for d in `ls /usr/share/festival/voices/english` ; do
if [[ "$d" =~ "cmu_us_" ]] ; then
sudo mv "/usr/share/festival/voices/english/${d}" "/usr/share/festival/voices/english/${d}_clunits"
fi ; done
# remove downloaded files
> cd ../
> rm -rf cmu_tmp/
# if you want to change the default voice, you can add the following line to the end of /etc/festival.scm
# (set! voice_default 'voice_cmu_us_slt_arctic_clunits)
# then, you can use the following command to try the voice:
# > echo 'This is a test' | festival --tts

4. Download the Code

> cd ~/catkin_ws/src
> git clone https://github.com/adennis96/lili-core.git
> cd lili-core
> git checkout storytellingFeature
> mv * ../
> cd ~/catkin_ws
> rm -r ~/catkin_ws/src/lili-core
> catkin_make
> cd /opt/ros/kinetic/lib/audio_capture/
> sudo mv audio_capture audio_capture_old
> sudo cp ~/catkin_ws/src/lili_audio/include/audio_capture ./
> cd ~/catkin_ws/devel/lib/python2.7/dist-packages
> pwd
# Let's assume that the ouput of pwd is NOW_PATH, then add the following two commands to the end of your ~/.bashrc file
export PYTHONPATH=$PYTHONPATH:NOW_PATH
# e.g.: export PYTHONPATH=$PYTHONPATH:/home/xin/catkin_ws/devel/lib/python2.7/dist-packages

5. Go to Google Cloud login your google account and click "TRY IT FREE".

# add the follwing line to the end of your ~/.bashrc file.
export GOOGLE_APPLICATION_CREDENTIALS=<your_own_json_path>
# e.g.: export GOOGLE_APPLICATION_CREDENTIALS=/home/xin/Downloads/Lilyrobot-a96437f84.json
> source ~/.bashrc
> exit

6. Run code

# change one line code in ~/catkin_ws/src/lili_storytelling/src/dialog.py[line 2]
# add an element "None" to the beginning of characterList.
# in one terminal
> source ~/catkin_ws/devel/setup.bash
> roscore
# in another terminal
> source ~/catkin_ws/devel/setup.bash
> roslaunch lili_storytelling story_telling.launch # fullscreen:=false